# Maintainer: Sébastien Luttringer

pkgname=archivetools
pkgver=3
pkgrel=3
pkgdesc='Arch Linux Archive Tools'
arch=('any')
url='https://gitlab.archlinux.org/archlinux/archivetools'
license=('GPL2')
depends=('rsync' 'hardlink' 'xz' 'util-linux' 'systemd' 'bash')
makedepends=('git')
backup=('etc/archive.conf')
source=("git+https://gitlab.archlinux.org/archlinux/archivetools.git#tag=v$pkgver")
md5sums=('SKIP')

prepare() {
  cd $pkgname
  # archive.sh: Exclude debug packages during repo sync
  git format-patch -1 --stdout 35e4faa80cb6 | patch -Np1
}

package() {
  cd $pkgname
  install -Dm644 archive.conf "$pkgdir/etc/archive.conf"
  install -Dm755 archive.sh "$pkgdir/usr/bin/archive"
  install -Dm755 archive-cleaner -t "$pkgdir/usr/bin"
  # systemd stuff
  install -Dm644 archive.sysusers "$pkgdir/usr/lib/sysusers.d/archive.conf"
  install -Dm644 archive.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/archive.conf"
  for _p in archive.{timer,service} archive-hardlink.{timer,service}; do
    install -Dm644 $_p "$pkgdir/usr/lib/systemd/system/$_p"
  done
}

# vim:set ts=2 sw=2 et:
